package cn.edu.nju.software.zp13.client.assignment3.xmlNodeEntity;

import cn.edu.nju.software.zp13.client.assignment3.xmlNodeEntity.util.ScoreType;
import cn.edu.nju.software.zp13.core.annotation.Attribute;
import cn.edu.nju.software.zp13.core.annotation.Element;
import cn.edu.nju.software.zp13.core.xmlNodeEntity.XmlNodeEntity;

@Element(tagName = "课程成绩")
public class CourseScore extends XmlNodeEntity {
	@Attribute(name="课程编号")
	private String courseId;
	@Attribute(name="成绩性质")
	private ScoreType st;
	@Element
	private Score score;
	
	@Attribute(name="成绩性质")
	public String scoreTypeToString(){
		return st.toString();
	}
	
	public Score getScore() {
		return score;
	}

	public void setScore(Score score) {
		this.score = score;
	}

	public ScoreType getSt() {
		return st;
	}

	public void setSt(ScoreType st) {
		this.st = st;
	}

	public String getCourseId() {
		return courseId;
	}

	public void setCourseId(String courseId) {
		this.courseId = courseId;
	}

	@Override
	public CourseScore clone() throws CloneNotSupportedException {
		CourseScore cs=new CourseScore();
		cs.setCourseId(this.getCourseId());
		cs.setSt(this.getSt());
		cs.setScore(new Score(this.score.getStudentId(),this.score.getScore()));
		return cs;
	}
	
	
}
